package com.longma.server.exception;


import com.longma.server.constant.enums.ResponseCode;
import lombok.Data;


/**
 * @author HIBO
 * @Description 业务出错统一处理异常
 */

@Data
public class BusinessException extends RuntimeException {
    /**
     * 状态码
     */
    private final ResponseCode responseCode;

    /**
     * 构造函数
     * @param responseCode
     */
    public BusinessException(ResponseCode responseCode){
        super(responseCode == null ? ResponseCode.FAIL.getMessage() : responseCode.getMessage());
        this.responseCode = responseCode == null ? ResponseCode.FAIL : responseCode;
}
}
